package com.example.jakartadata;

import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import jakarta.persistence.Persistence;

public class Main {
    public static void main(String[] args) {
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("example");
        EntityManager em = emf.createEntityManager();

        em.getTransaction().begin();
        User user = new User();
        user.setId(5L);
        user.setName("jakarta data");
        user.setPhone("189");
        user.setUserName("jun");
        em.persist(user);

        em.getTransaction().commit();

        em.close();
        emf.close();
    }
}
